Capella provides the capacity to launch actions from command line. Potential actions are Model Validation, HTML Production, XML Export, Export as ZIP and Migration.
The core mechanism provides the following parameters:
| Name | Category | Description |
|---|---|---|
| appid | mandatory | defines the id of the command line application to launch. Command line applications are plugins that extend the core mechanism (e.g. model validation) |
| filepath | mandatory | defines the path to your aird file |
| outputfolder | mandatory | defines the path to the output folder |
| nosplash | optional | launch Capella without the initial splash screen |
| consolelog | optional | allows to log messages into the console output |
| data | optional | defines the path to the workspace |
| import | optional | defines a list of the path of the Eclipse projects to import into the workspace before doing the actual job. The list have to be placed into quotes "" and separated by a pipe character |
| forceimport | optional | unreference/delete exiting project from the workspace while importing projects using command line. Without this option, an error is logged if a project with the same name than the imported project exists already in the workspace |
| forceoutputfoldercreation | optional | automatically create the output folder. If the folder already exists, this one is deleted and a new output folder is created |
| logfile | optional | defines the path to the log file (if not specified, log file is created in the workspace directory) |
| help | optional | prints the help message |
|
|
Simple use case:
<CapellaInstallationPath>/eclipse.exe -nosplash
-application org.polarsys.capella.core.commandline.core
-appid org.polarsys.capella.core.validation.commandline
-data <workspacePath>
-filepath /EOLE_AF/EOLE_AF.aird
-outputfolder /DocProject/validation
-logfile D:\CommandLineLog\log.html
This command validates the model corresponding to the <workspacePath>/EOLE_AF/EOLE_AF.aird file and generates a report to the output folder <workspacePath>/DocProject/validation.
DocProject must be a general Eclipse project (not a directory) initially created into the specified workspace, with inside a folder named validation. As well, EOLE_AF must exist as Capella project inside the same workspace. A log file can be also specified with the parameter -logfile
Complex use case:
<CapellaInstallationPath>/eclipse.exe -nosplash
-application org.polarsys.capella.core.commandline.core
-appid org.polarsys.capella.core.validation.commandline
-filepath /EOLE_AF/EOLE_AF.aird
-outputfolder /DocProject/validation
-forceoutputfoldercreation
-validationruleset D:/EPF/exportall.epf
-validationcontext "EOLE_AF/EOLE_AF.melodymodeller#971d9934-9780-4e41-b02e-312d0eac3223 |
EOLE_AF EOLE_AF/fragments/OA-Operational%20Context-Operational%20Entity.melodyfragment#c6aebe52-c8a4-4d35-8105-177c87470bef "
-data <workspacePath>
-logfile D:\CommandLineLog\log.html
This new command uses a -validationruleset parameter to specify the path to an Eclipse Property File (epf file) and a -validationcontext parameter to specify the set of URIs of model elements to validate. The set of rule to validate against are stored into the exported epf file.
The parameter -forceoutputfoldercreation becomes necessary for the following cases :
A log file is also specified.
| Prerequisites: XHTML Add-on has to be installed. |
Simple use case:
<CapellaInstallationPath>/eclipse.exe -nosplash
-application org.polarsys.capella.core.commandline.core
-appid org.polarsys.kitalpha.doc.gen.business.capella.commandline
-data <workspacePath>
-filepath /EOLE_AF/EOLE_AF.aird
-outputfolder /DocProject/HTML
-forceoutputfoldercreation
This command will generate HTML report from the EOLE-AF aird file specified to the output folder HTML present into Doc project.
Complex use cases:
</br>
Import Capella project and generate inside it
<CapellaInstallationPath>/eclipse.exe -nosplash
-application org.polarsys.capella.core.commandline.core
-appid org.polarsys.kitalpha.doc.gen.business.capella.commandline
-data <targetWorkspacePath>
-import <absolutePath>/EOLE_AF
-filepath /EOLE_AF/EOLE_AF.aird
-outputfolder /EOLE_AF/HTML
-forceoutputfoldercreation
-logfile D:/CommandLineLog/log.html
This command will import the EOLE_AF project from <absolutePath> workspace into <targetWorkspacePath> workspace before generating the HTML report inside it.
</br>
Import Capella project and generate inside a new project
</br>
<CapellaInstallationPath>/eclipse.exe -nosplash
-application org.polarsys.capella.core.commandline.core
-appid org.polarsys.kitalpha.doc.gen.business.capella.commandline
-data <targetWorkspacePath>
-import <absolutePath>/EOLE_AF
-filepath /EOLE_AF/EOLE_AF.aird
-outputfolder /DocProject/HTML
-forceoutputfoldercreation
-logfile D:/CommandLineLog/log.html
This command will import the EOLE_AF project from <absolutePath> workspace into <targetWorkspacePath> workspace and create the DocProject to generate the HTML report inside it.
Import Capella project and a Doc project to generate inside it
<CapellaInstallationPath>/eclipse.exe -nosplash
-application org.polarsys.capella.core.commandline.core
-appid org.polarsys.kitalpha.doc.gen.business.capella.commandline
-data <targetWorkspacePath>
-import "<absolutePath>/EOLE_AF | <absolutePath>/DocProject"
-filepath /EOLE_AF/EOLE_AF.aird
-outputfolder /DocProject/HTML
-forceoutputfoldercreation
-logfile D:/CommandLineLog/log.html
This command will import two projects (EOLE_AF and DocProject) from <absolutePath> workspace into <targetWorkspacePath> workspace before generating the HTML report inside the DocProject.
NOTE: The source and target workspaces have to be different.
| Prerequisites: XML Pivot Add-on has to be installed. |
Another Capella headless commandline application is the XML export. The following command runs an export in headless mode:
<CapellaInstallationPath>/eclipse.exe -consoleLog -nosplash
-application org.polarsys.capella.core.commandline.core
-appid xmlpivot.export
-filepath <Path>
The filepath argument may either be a relative or an absolute path. If it is a relative path, it is interpreted relative to the workspace. To specify an explicit workspace, you can use the –data parameter.
Simple use cases:
<CapellaInstallationPath>/eclipse.exe -consoleLog –nosplash
-application org.polarsys.capella.core.commandline.core
-appid xmlpivot.export
-filepath C:/EOLE_AF/EOLE_AF.melodymodeller
This command exports a capella model into an xml file stored at filepath path.
This command will export selected project to the given zip filename
Mandatory parameters:
(usage of “qualifier” in the output file name will be replaced by current date/time)
Simple use case:
<CapellaInstallationPath>/eclipse.exe -nosplash
-application org.polarsys.capella.core.commandline.core
-appid org.polarsys.capella.core.commandline.core.exportZip
-data <workspacePath>
-export "EOLE_AF"
-exportZipName "/EOLE_AF/EOLE_qualifier.zip"
-filepath "/EOLE_AF/EOLE_AF.aird"
-outputfolder "/EOLE_AF/output"
-forceoutputfoldercreation
-logfile "D:\ CommandLineLog \log.html"
This command will migrate the project(s) given as input. A workspace folder is created and located where the command is triggered or in a specified path given by the -data parameter. It creates a log file located in the .metadata folder of the workspace. If the input project is a folder, it will be backed up and migrated inside this folder, otherwise if the input is a zip file it will be unzipped and project(s) inside it will be migrated into the workspace folder.
The parameter -import is mandatory, but parameters -filepath and -outputfolder are not.
Simple use case:
<CapellaInstallationPath>/eclipse.exe -nosplash
-application org.polarsys.capella.core.commandline.core
-appid org.polarsys.capella.migration
-import D:/Projects/EOLE_AF.zip
-data <workspacePath>
This command imports a .zip into the specified workspace and migrate all projects inside.
If you migrate a project using libraries, all dependent projects/libraries must be included and the sequence order matters.
Consider the example below:
The migration process must be done according to the following sequence:
In such a case, the migration sequence can be done either by launching several unary migration commands on each project/library or by giving the whole sequence through the -import parameter (using | separator).
Complex use case:
<CapellaInstallationPath>/eclipse.exe -nosplash
-application org.polarsys.capella.core.commandline.core
-appid org.polarsys.capella.migration
-import "D:/Projects/Library3 | D:/Projects/Library1 | D:/Projects/Library2 | D:/Projects/Project1"
-data <workspacePath>
-logfile D:\CommandLineLog\log.html
This command migrates the given project/libraries and creates a log.html at the specified location.